<template>
    <div style="height:100%;width:100%;position:relative;">
        <div class="pagetop">
            <div style="width:100%;height:100%;white-space: nowrap;min-width: 1100px;">
                <div class="search-title">
                    <table>
                        <tr>
                            <td><span style="font-size:18px;font-weight:bold">条形码</span></td>
                            <td colspan="5">
                                <div class="my-input">
                                    <el-input v-model="searchobj.barcode" @keyup.native.enter="scanBarcode" @focus="focusevent($event)" clearable ref="refbarcode"></el-input>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">日期</td>
                            <td>
                                <el-date-picker v-model="searchobj.startdate" type="date" placeholder="选择日期" style="width:130px" value-format="yyyy-MM-dd" :clearable="false">
                                </el-date-picker>
                            </td>
                            <td>至</td>
                            <td>
                                <el-date-picker v-model="searchobj.enddate" type="date" placeholder="选择日期" style="width:130px" value-format="yyyy-MM-dd" :clearable="false">
                                </el-date-picker>
                            </td>
                            <td align="right">病历号</td>
                            <td>
                                <el-input v-model="searchobj.patno" style="width:120px" @keyup.native.enter="scanBarcode" @focus="focusevent($event)" clearable></el-input>
                            </td>
                            <td align="right">病人姓名</td>
                            <td>
                                <el-input v-model="searchobj.patname" style="width:80px" @keyup.native.enter="scanBarcode" @focus="focusevent($event)" clearable></el-input>
                            </td>
                            <td align="right">病人卡号</td>
                            <td>
                                <el-input v-model="searchobj.pat_cardno" style="width:120px" @keyup.native.enter="scanBarcode" @focus="focusevent($event)" clearable></el-input>
                            </td>
                            <td>
                                <el-button @click="scanBarcode" icon="el-icon-search" type="primary" v-has="'PINQUERY'">查询</el-button>
                                <el-button @click="btnClear" icon="el-icon-s-open">清除</el-button>
                                <el-button @click="btnClose" icon="el-icon-close">退出</el-button>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <div class="pagecenter">
            <rm-layout-top splitcolor="white" :splitwidth=5 :fixsize=150 :rememberConfig="false" :canDrag="false">
                <template v-slot:fix>
                    <div style="height:100%;">
                        <vxe-table :data.sync="ReqMasterData" :loading="masterloading" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border height="auto" highlight-current-row highlight-hover-column highlight-hover-row how-header-overflow ref="masterTable" resizable show-overflow size="mini" stripe show-header-overflow :optimization="{ animat: false }" header-align="center" :key="xTableKey" class="mytable-style" @current-change="currentChangeEvent" :cell-class-name="masterCellClassName">
                            <vxe-table-column :field="items.field" :key="index" :title="items.title" sortable v-for="(items,index) in ReqMasterCol" :width="items.width" :align="items.align" header-align="center" :formatter="items.format">
                                <template v-slot="{row}">
                                    <div v-if="items.field=='labadd'">
                                        <el-checkbox true-label="1" false-label="0" v-model="row[items.field]" :disabled="true"></el-checkbox>
                                    </div>
                                    <div v-else>
                                        {{row[items.field]}}
                                    </div>
                                </template>
                            </vxe-table-column>
                        </vxe-table>
                    </div>
                </template>
                <div style="height:100%;width:100%;">
                    <rm-layout-left splitcolor="white" movingcolor="#00ffff" :splitwidth=5 fixsize="25%" :minfixsize=80>
                        <template v-slot:fix>
                            <div style="height:100%">
                                <vxe-table :data.sync="ReqDetailData" :loading="loading" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border height="auto" :row-class-name="ReqItemRowName" how-header-overflow ref="detailTable" resizable show-overflow size="mini" stripe show-header-overflow :optimization="{ animat: false }" header-align="center" :key="xTableKey" class="mytable-style">
                                    <vxe-table-column :field="items.field" :key="index" :title="items.title" sortable v-for="(items,index) in ReqDetailCol" :width="items.width" :align="items.align" header-align="center">
                                    </vxe-table-column>
                                </vxe-table>
                            </div>
                        </template>
                        <rm-layout-right splitcolor="white" movingcolor="#00ffff" :splitwidth=5 fixsize="50%" :minfixsize=80>
                            <template v-slot:fix>
                                <div style="height:100%">
                                    <rm-layout-top splitcolor="white" movingcolor="#00ffff" :splitwidth=5 :fixsize=150 :rememberConfig="false" :canDrag="false">
                                        <template v-slot:fix>
                                            <div style="height:100%;">
                                                <vxe-table :data.sync="LabReportData" :loading="loading" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border height="auto" highlight-current-row highlight-hover-column highlight-hover-row how-header-overflow ref="reportTable" resizable show-overflow size="mini" stripe show-header-overflow :optimization="{ animat: false }" header-align="center" :key="xTableKey" class="mytable-style" :cell-class-name="reportCellClassName" @cell-dblclick="cellDblClickEvent" >
                                                    <vxe-table-column :field="items.field" :key="index" :title="items.title" sortable v-for="(items,index) in LabReportCol" :width="items.width" :align="items.align" header-align="center" :formatter="items.format">
                                                        <template v-if="items.field == 'sampleno'" v-slot="{ row }">
                                                            <span style="color:blue;">{{row.sampleno}}</span>
                                                        </template>
                                                    </vxe-table-column>
                                                </vxe-table>
                                            </div>
                                        </template>
                                        <div style="height:100%;width:100%;">
                                            <vxe-table :data.sync="LogsData" :loading="loading" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border height="auto" highlight-current-row highlight-hover-column highlight-hover-row how-header-overflow ref="logsTable" resizable show-overflow size="mini" stripe show-header-overflow :optimization="{ animat: false }" header-align="center" :key="xTableKey" class="mytable-style">
                                                <vxe-table-column :field="items.field" :key="index" :title="items.title" sortable v-for="(items,index) in LogsCol" :width="items.width" :align="items.align" header-align="center">
                                                    <template v-if="items.field == 'computer_name'" v-slot="{ row }">
                                                        <span style="color:blue;">{{row.computer_name}}</span>
                                                        <i class="el-icon-refresh" @click="repalceComputerName(row)"></i>
                                                    </template>
                                                </vxe-table-column>
                                            </vxe-table>
                                        </div>
                                    </rm-layout-top>
                                </div>
                            </template>
                            <div style="height:100%;width:100%;">
                                <vxe-table :data.sync="LabResultData" :loading="loading" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border height="auto" highlight-current-row highlight-hover-column highlight-hover-row how-header-overflow ref="resultTable" resizable show-overflow size="mini" stripe show-header-overflow :optimization="{ animat: false }" header-align="center" :key="xTableKey" class="mytable-style">
                                    <vxe-table-column :field="items.field" :key="index" :title="items.title" sortable v-for="(items,index) in LabResultCol" :width="items.width" :align="items.align" header-align="center">
                                        <template v-slot="{row}">
                                            <div v-if="items.field=='result_str'" :style="{background: row.cp_resultbackgroundcolor,color: row.cp_resultcolor}">
                                                {{row[items.field]}}</div>
                                            <div v-else>{{row[items.field]}}</div>
                                        </template>
                                    </vxe-table-column>
                                </vxe-table>
                            </div>
                        </rm-layout-right>
                    </rm-layout-left>
                </div>
            </rm-layout-top>
        </div>
    </div>
</template>

<script type="text/javascript">
import XEUtils from "xe-utils";
export default {
    name: "LIS229",
    data() {
        return {
            searchobj: { startdate: this.$pub.InitDate(), enddate: this.$pub.InitDate() },
            masterloading: false,
            loading: false,
            ReqMasterCol: [
                { title: "病人来源", field: "pat_typename", width: "70", align: "center" },
                { title: "病历号", field: "pat_no", width: "90", align: "left" },
                { title: "姓名", field: "pat_name", width: "50", align: "center" },
                { title: "分单类别", field: "req_groupna", width: "80", align: "left" },
                { title: "状态", field: "req_statname", width: "60", align: "center" },
                { title: "加急", field: "emer_flagname", width: "40", align: "center" },
                { title: "申请项目(简称,部分)", field: "sample_items", width: "120", align: "left" },
                { title: "标本类型", field: "specimen_name", width: "80", align: "center" },
                { title: "创建时间", field: "create_dt", width: "120", align: "center" },
                { title: "申请科室", field: "req_deptname", width: "100", align: "left" },
                { title: "申请医生", field: "req_docname", width: "70", align: "center" },
                { title: "病区", field: "req_wardname", width: "100", align: "left" },
                { title: "床号", field: "req_bedno", width: "50", align: "center" },
                { title: "应收金额", field: "base_amount", width: "70", align: "right" },
                { title: "条码号", field: "barcode", width: "120", align: "center" },
                { title: "性别", field: "pat_sexname", width: "40", align: "center" },
                { title: "年龄", field: "pat_agestr", width: "50", align: "center" },
                { title: "实验室增加标志", field: "labadd", width: "80", align: "center" },
                { title: "创建人", field: "create_username", width: "60", align: "center" },
                { title: "打印/执行时间", field: "print_dt", width: "120", align: "center" },
                { title: "打印/执行人", field: "print_username", width: "80", align: "center" },
                { title: "打印次数", field: "print_count", width: "80", align: "center" },
                { title: "采样时间", field: "sampled_dt", width: "120", align: "center" },
                { title: "采样人", field: "sampled_username", width: "60", align: "center" },
                { title: "申请时间", field: "req_dt", width: "120", align: "center" },
                { title: "预出报告时间", field: "prereport_dt", width: "120", align: "center" },
                { title: "报告领取说明", field: "prereport_comm", width: "100", align: "center" },
                { title: "临床诊断", field: "pat_diag", width: "80", align: "center" },
                { title: "病人ID号", field: "pat_id", width: "100", align: "center" },
                { title: "入院日期", field: "inp_date", width: "90", align: "center" },
                { title: "送出时间", field: "send_dt", width: "90", align: "center" },
                { title: "送出人", field: "send_username", width: "60", align: "center" },
                { title: "接收时间", field: "recieve_dt", width: "120", align: "center" },
                { title: "接收人", field: "recieve_username", width: "60", align: "center" },
                { title: "计价时间", field: "charge_dt", width: "90", align: "center" },
                { title: "计价人", field: "charge_username", width: "60", align: "center" },
                { title: "实收金额", field: "amount", width: "60", align: "right" },
                { title: "计价标志", field: "charge_flag", width: "70", align: "center" },
                { title: "上机时间", field: "test_dt", width: "90", align: "center" },
                { title: "上机人", field: "test_username", width: "70", align: "center" },
                { title: "报告时间", field: "report_dt", width: "90", align: "center" },
                { title: "检验医生姓名", field: "report_username", width: "80", align: "center" },
                { title: "核对医生姓名", field: "rechk_username", width: "80", align: "center" },
                { title: "报警", field: "alter_flag", width: "60", align: "center" },
                { title: "销售员", field: "saleman", width: "70", align: "center" },
                { title: "就诊卡号", field: "pat_cardno", width: "80", align: "center" },
                { title: "医生备注", field: "req_comm", width: "80", align: "center" },
                { title: "生日", field: "pat_birth", width: "80", align: "center" },
                { title: "年龄岁数", field: "pat_ageyear", width: "75", align: "center" },
                { title: "住院标识/就诊号", field: "inp_id", width: "100", align: "center" },
                { title: "诊断标准代码", field: "pat_diag_icd", width: "80", align: "center" },
                { title: "地址", field: "pat_address", width: "100", align: "center" },
                { title: "国籍", field: "pat_nation", width: "80", align: "center" },
                { title: "身份证/护照号", field: "pat_idcardno", width: "100", align: "center" },
                { title: "联系电话", field: "pat_phone", width: "80", align: "center" },
                { title: "费别代码", field: "charge_typeno", width: "80", align: "center" },
                { title: "执行科室", field: "perform_dept", width: "80", align: "center" },
                { title: "病区代码", field: "req_wardno", width: "80", align: "center" },
                { title: "原始申请单号", field: "original_reqno", width: "80", align: "center" },
                { title: "加密", field: "secrecy", width: "50", align: "center" },
                { title: "其他状态", field: "other_stat", width: "80", align: "center" },
                { title: "作废时间", field: "cancel_dt", width: "120", align: "center" },
                { title: "作废人", field: "cancel_username", width: "60", align: "center" },
                { title: "剔回时间", field: "reject_dt", width: "120", align: "center" },
                { title: "剔回人", field: "reject_username", width: "60", align: "center" },
                { title: "踢回原因", field: "reject_reason", width: "80", align: "center" },
                { title: "踢回次数", field: "reject_count", width: "80", align: "center" },
                { title: "标本类型代码", field: "specimen_code", width: "80", align: "center" },
                { title: "标本备注说明", field: "sample_detail", width: "100", align: "center" },
                { title: "检验目的", field: "req_reason", width: "100", align: "center" },
                { title: "主申请单ID", field: "master_barcode", width: "80", align: "center" },
                { title: "子申请单序号", field: "multi_seq", width: "80", align: "center" },
                { title: "分单类别ID", field: "req_groupid", width: "80", align: "center" },
                { title: "报告单ID", field: "report_id", width: "80", align: "center" },
                { title: "检验医生代码", field: "report_user", width: "80", align: "center" },
                { title: "核对医生代码", field: "rechk_user", width: "80", align: "center" },
                { title: "工作组签收时间", field: "recieve1_dt", width: "120", align: "center" },
                { title: "工作组签收人", field: "recieve1_username", width: "80", align: "center" },
                { title: "入库状态", field: "inlib_status", width: "80", align: "center" },
                { title: "所在库位ID", field: "library_id", width: "80", align: "center" },
                { title: "申请单类别", field: "reqtypename", width: "80", align: "center" },
                { title: "身高(cm)", field: "pat_height", width: "60", align: "center" },
                { title: "体重(kg)", field: "weight", width: "60", align: "center" },
                { title: "ABO血型", field: "abo_bldtype", width: "80", align: "center" },
                { title: "RH血型", field: "rh_bldtype", width: "80", align: "center" },
                { title: "试管颜色", field: "tube_color", width: "80", align: "center" },
            ],
            ReqMasterData: [],
            ReqDetailCol: [
                { title: "项目名称", field: "req_itemname", width: "160", align: "left" },
                { title: "基础价格", field: "base_price", width: "60", align: "right" },
                { title: "数量", field: "qty", width: "50", align: "center" },
                { title: "实际价格", field: "item_price", width: "60", align: "right" },
                { title: "金额", field: "amount", width: "60", align: "right" },
                { title: "项目代码", field: "req_itemcode", width: "90", align: "left" },
                { title: "HIS项目代码", field: "his_itemcode", width: "90", align: "center" },
                { title: "HIS记录号", field: "his_recordid", width: "80", align: "center" },
                { title: "统计标记", field: "stat_flag", width: "60", align: "left" },
                { title: "其他标记", field: "other_flag", width: "60", align: "center" },
                { title: "状态", field: "status", width: "60", align: "left" },
                { title: "实验室新增", field: "lab_add", width: "80", align: "left" },
                { title: "新增时间", field: "add_dt", width: "60", align: "center" },
                { title: "新增人", field: "add_username", width: "60", align: "center" },
                { title: "条码号", field: "barcode", width: "90", align: "left" },
                { title: "序号", field: "seq", width: "50", align: "center" },
                { title: "分单类别", field: "req_groupid", width: "80", align: "left" },
                { title: "计价标志", field: "charge_flag", width: "60", align: "left" },
                { title: "his_refcol1", field: "his_refcol1", width: "80", align: "center" },
                { title: "his_refcol2", field: "his_refcol2", width: "80", align: "center" },
                { title: "his_refcol3", field: "his_refcol3", width: "80", align: "center" },
                { title: "上机报告ID", field: "reportid", width: "80", align: "left" },
            ],
            ReqDetailData: [],
            LabResultCol: [
                { title: "报告项目", field: "rpt_itemname", width: "180", align: "left" },
                { title: "检验结果", field: "result_str", width: "80", align: "left" },
                { title: "参考值", field: "result_ref", width: "80", align: "left" },
                { title: "单位", field: "result_unit", width: "60", align: "left" },
                { title: "报告ID", field: "reportid", width: "100", align: "center" },
                { title: "项目代码", field: "rpt_itemcode", width: "70", align: "center" },
            ],
            LabResultData: [],
            LabReportCol: [
                { title: "危", field: "alter_flagname", width: "30", align: "center" },
                { title: "急", field: "emer_flagname", width: "30", align: "center" },
                { title: "复", field: "redo_flagname", width: "30", align: "center" },
                { title: "审", field: "rechkflagname", width: "30", align: "center" },
                { title: "报告单元", field: "rptunitidname", width: "90", align: "left" },
                { title: "标本日期", field: "sampledate", width: "90", align: "center", format: ["toDateString", "yyyy-MM-dd"] },
                { title: "标本编号", field: "sampleno", width: "80", align: "left" },
                { title: "标本类型", field: "specimen_name", width: "80", align: "left" },
                { title: "接收时间", field: "recieve_dt", width: "120", align: "center" },
                { title: "录入时间", field: "input_dt", width: "120", align: "center" },
                { title: "采样时间", field: "sampled_dt", width: "120", align: "center" },
                { title: "上机信息", field: "test_info", width: "100", align: "left" },
                { title: "上机时间", field: "test_dt", width: "120", align: "left" },
                { title: "检验医生", field: "report_username", width: "80", align: "center" },
                { title: "审核医生", field: "rechk_username", width: "80", align: "center" },
                { title: "审核时间", field: "rechk_dt", width: "120", align: "center" },
                { title: "报告时间", field: "report_dt", width: "120", align: "center" },
                { title: "报告单备注", field: "report_comm", width: "120", align: "left" },
                { title: "实验室意见", field: "lab_advice", width: "80", align: "left" },
                { title: "项目数", field: "item_num", width: "60", align: "center" },
                { title: "病人姓名", field: "pat_name", width: "60", align: "center" },
                { title: "病人号", field: "pat_no", width: "90", align: "left" },
                { title: "性别", field: "pat_sexname", width: "40", align: "center" },
                { title: "打印次数", field: "print_count", width: "60", align: "center" },
                { title: "接收-报告(分钟)", field: "receive_report", width: "100", align: "center" },
                { title: "采样-接收(分钟)", field: "sampled_receive", width: "100", align: "center" },
                { title: "送检目的", field: "req_reason", width: "100", align: "left" },
                { title: "年龄", field: "pat_agestr", width: "60", align: "center" },
                { title: "床号", field: "req_bedno", width: "60", align: "center" },
                { title: "病人类别", field: "pat_typename", width: "80", align: "center" },
                { title: "条码号", field: "barcode", width: "100", align: "left" },
                { title: "申请科室", field: "req_deptname", width: "100", align: "left" },
                { title: "病人病区", field: "req_wardname", width: "100", align: "left" },
                { title: "收费类别", field: "charge_typeno", width: "80", align: "left" },
                { title: "临床诊断", field: "pat_diag", width: "80", align: "left" },
                { title: "申请时间", field: "req_dt", width: "120", align: "center" },
                { title: "申请医生", field: "req_docno", width: "80", align: "center" },
                { title: "仪器辅助诊断", field: "instr_advice", width: "80", align: "left" },
                { title: "二审时间", field: "rechk2_dt", width: "90", align: "center" },
                { title: "二审医生", field: "rechk2_user", width: "120", align: "center" },
                { title: "最后打印时间", field: "lastprint_dt", width: "90", align: "center" },
                { title: "生日", field: "pat_birth", width: "90", align: "center", format: ["toDateString", "yyyy-MM-dd"] },
                { title: "报告ID", field: "reportid", width: "90", align: "left" },
                { title: "送检医院", field: "hospcode", width: "100", align: "left" },
                { title: "标本状态备注", field: "specimen_comm", width: "90", align: "center" },
                { title: "就诊卡号", field: "pat_cardno", width: "80", align: "center" },
                { title: "就诊号", field: "inp_id", width: "80", align: "left" },
                { title: "入院日期", field: "inp_date", width: "90", align: "center" },
                { title: "联系电话", field: "pat_phone", width: "90", align: "left" },
                { title: "病人ID", field: "pat_id", width: "80", align: "center" },
                { title: "发布时间", field: "release_dt", width: "90", align: "center" },
                { title: "发布人", field: "release_username", width: "60", align: "center" },
                { title: "修改", field: "is_changed", width: "50", align: "center" },
                { title: "打印或审核后修改", field: "changed_afterreport", width: "100", align: "center" },
                { title: "禁止打印标志", field: "unprint_flag", width: "80", align: "center" },
                { title: "禁止打印原因", field: "unprint_reason", width: "80", align: "left" },
            ],
            LabReportData: [],
            LogsCol: [
                { title: "操作日期", field: "log_date", width: "120", align: "left" },
                { title: "操作类型", field: "trans_type", width: "70", align: "left" },
                { title: "操作者", field: "log_username", width: "60", align: "center" },
                { title: "操作内容", field: "log_content", width: "90", align: "left" },
                { title: "操作时机器名", field: "computer_name", width: "90", align: "center" },
                { title: "操作时机器MAC", field: "mac_address", width: "100", align: "center" },
                { title: "同步HIS标志", field: "syncflag", width: "80", align: "center" },
                { title: "同步时间", field: "synctime", width: "90", align: "center" },
                { title: "同步失败信息", field: "syncerrtext", width: "100", align: "left" },
            ],
            LogsData: [],
            xTableKey: 0,
            PushToFlag: true, // 双击标本号跳转对应报告单元确认消息是否已经弹出过标志
            rptunitAll: [],
        };
    },
    created() {
        //this.getinitdata(); //初始化下拉框的数据
    },
    mounted() {
        if (this.$refs.refbarcode) this.$refs.refbarcode.focus();
    },
    updated() {},
    methods: {
        //条码号查询
        scanBarcode() {
            this.masterloading = true;
            this.loading = true;
            if (this.$refs.refbarcode) {
                this.$refs.refbarcode.focus();
                this.$refs.refbarcode.select();
            }
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS229",
                    method: "post",
                    timeout: 600000,
                    data: {
                        action: "scanBarcode",
                        ...this.searchobj,
                    },
                })
                .then((res) => {
                    this.rptunitAll = res.rptunitAll;
                    this.ReqMasterData = res.ReqMasterData;
                    if (res.ReqMasterData.length > 0) this.$refs.masterTable.setCurrentRow(res.ReqMasterData[0]);
                    this.ReqDetailData = res.ReqDetailData;
                    this.LabResultData = res.LabResultData;
                    this.LabReportData = res.LabReportData;
                    this.LogsData = res.LogsData;
                    this.loading = false;
                    this.masterloading = false;
                })
                .catch((e) => {
                    this.loading = false;
                    this.masterloading = false;
                    this.$alert(e, "提示");
                });
        },
        currentChangeEvent({ row, column }) {
            //master切换行
            this.loading = true;
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS229",
                    method: "post",
                    data: {
                        action: "masterRowChange",
                        barcode: row.barcode,
                    },
                })
                .then((res) => {
                    this.ReqDetailData = res.ReqDetailData;
                    this.LabResultData = res.LabResultData;
                    this.LabReportData = res.LabReportData;
                    this.LogsData = res.LogsData;
                    this.loading = false;
                })
                .catch((e) => {
                    this.loading = false;
                    this.$alert(e, "提示");
                });
        },
        btnClear() {
            this.ReqMasterData = [];
            this.ReqDetailData = [];
            this.LabResultData = [];
            this.LabReportData = [];
            this.LogsData = [];
            this.searchobj = { startdate: this.$pub.InitDate(), enddate: this.$pub.InitDate() };
        },
        btnClose() {
            this.$pub.closePage(this, "LIS229");
        },
        focusevent(event) {
            event.currentTarget.select();
        },
        masterCellClassName({ column, row, columnIndex }) {
            if (column.property == "emer_flagname") {
                return "font-red";
            } else if (column.property == "req_statname") {
                return this.$pub.getreqstatclass(row.req_stat);
            } else {
                return "";
            }
        },
        ReqItemRowName({ row, rowIndex }) {
            if (!row.reportid) {
                return "rm_cell_yellow";
            }
        },
        reportCellClassName({ column, row, columnIndex }) {
            if (column.property == "emer_flagname") {
                return "font-red";
            } else if (column.property == "alter_flagname") {
                if (!!row.alter_flagname) {
                    return "col-red";
                } else {
                    return "";
                }
            } else if (column.property == "redo_flagname") {
                if (!!row.redo_flagname) {
                    return "col-green";
                } else {
                    return "";
                }
            } else if (column.property == "rechkflagname") {
                return "font-blue";
            } else {
            }
        },
        cellDblClickEvent({ row, column }) {
            if (column.property == "sampleno") {
                if (this.PushToFlag) {
                    this.$confirm("是否直接跳转到报告处理中查看？", {
                        confirmButtonText: "确定",
                        cancelButtonText: "取消",
                        type: "warning",
                    })
                        .then(() => {
                            this.PushToUnit(row);
                            this.PushToFlag = false;
                        })
                        .catch(() => { });
                } else this.PushToUnit(row);
            }
        },
        PushToUnit(row) {
            var pageinfo = this.$tool.getSession("RptPageInfo");
            var pagearr = JSON.parse(pageinfo);
            var multi = this.$tool.getLocalConfig("lis310multiple");
            row.AddBy410 = "1";
            row.sampledate = XEUtils.toDateString(row.sampledate, "yyyy-MM-dd"),
            this.$tool.setSession("RptTo", JSON.stringify(row));
            if (pagearr == null) pagearr = [];
            var prgno = "/LIS310";
            var unitinfo = this.rptunitAll[row.rptunitid];
            if (unitinfo) {
                switch (unitinfo.reporttype) {
                    case "10":
                        prgno = "/LIS310";
                        break;
                    case "20":
                        prgno = "/LIS311";
                        break;
                    case "50":
                        prgno = "/LIS312";
                        break;
                    case "40":
                        prgno = "/LIS313";
                        break;
                    case "60":
                        prgno = "/LIS314";
                        break;
                }
            }
            if (multi == "1") {
                //多开
                if (pagearr && pagearr.length == 0) {
                    pagearr.push({ id: 1, rptunitid: row.rptunitid, path: prgno + "?id=1", multi: "" });
                    this.$tool.setSession("RptPageInfo", JSON.stringify(pagearr));
                    this.$router.push({ path: prgno + "?id=1" });
                } else {
                    var findone = pagearr.find((item) => item.rptunitid == row.rptunitid);
                    //如果找到了该报告单元已打开，直接把他移动到最后,这样激活报告处理时直接取最后一个就行
                    if (findone) {
                        var idx = pagearr.indexOf(findone);
                        if (idx !== -1) {
                            var item = pagearr.splice(idx, 1)[0];
                            item.exci = '1';
                            pagearr.push(item);  
                        }
                        this.$tool.setSession("RptPageInfo", JSON.stringify(pagearr));
                        this.$router.push({ path: findone.path });
                    }
                    else {
                        var id = pagearr[pagearr.length - 1].id - 0 + 1;
                        pagearr.push({ id: id, rptunitid: row.rptunitid, path: prgno + "?id=" + id, multi: "" });
                        this.$tool.setSession("RptPageInfo", JSON.stringify(pagearr));
                        this.$router.push({ path: prgno + "?id=" + id });
                    }
                }
            } else {
                //单开
                if (pagearr && pagearr.length == 0) {
                    pagearr.push({ id: 0, rptunitid: row.rptunitid, path: prgno, multi: "" });
                    this.$tool.setSession("RptPageInfo", JSON.stringify(pagearr));
                    this.$router.push({ path: prgno });
                }
                else{
                    //已经打开页面
                    pagearr=[];
                    pagearr.push({ id: 0, rptunitid: row.rptunitid, path: prgno, multi: "" ,exci:'1'});
                    this.$tool.setSession("RptPageInfo", JSON.stringify(pagearr));
                    this.$router.push({ path: prgno});
                }
            }
        },
        repalceComputerName(row) {
            this.$pub.getComputerName(row.mac_address)
                .then((name)=> {
                    row.computer_name = name;
                })
                .catch(()=> {
                    this.$message.error("机器名称查询失败！");
                    //保持原样
                });
        },
    },
};
</Script>

<style scoped>
.pagetop {
    width: 100%;
    height: 70px;
    display: -webkit-box;
    -webkit-box-pack: left;
    -webkit-box-align: center;
    border: 1px solid #ccc;
    position: absolute;
    z-index: 99;
    overflow-x: auto;
    overflow-x: overlay;
}

.pagecenter {
    position: absolute;
    top: 75px;
    width: 100%;
    left: 0;
    bottom: 0px;
    overflow: auto;
}

/deep/ tr.vxe-body--row.row--current {
    color: #000000;
    font-weight: bold;
}

::-webkit-scrollbar {
    width: 0px;
    height: 5px;
    border: 4px solid white;
}

::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
}

::-webkit-scrollbar-track {
    background-color: #f1f1f1;
}

.search-title {
    margin: 0 5px 0 10px;
}
.top-deal {
    height: 25px;
    margin-right: 5px;
    text-align: right;
}

table {
    font-size: 12px;
    border-collapse: separate;
    border-spacing: 5px;
}

::v-deep .vxe-table .vxe-body--column.font-red {
    color: red;
    font-weight: 800;
    font-size: 16px;
}
::v-deep .mytable-style .vxe-body--column.col-red {
    background-color: red;
    color: #fff;
    font-size: 16px;
}
::v-deep .mytable-style .vxe-body--column.col-green {
    background-color: green;
    color: #fff;
    font-size: 16px;
}
::v-deep .vxe-table .vxe-body--column.font-blue {
    color: blue;
    font-weight: 800;
    font-size: 16px;
}
::v-deep .my-input .el-input--small .el-input__inner {
    font-size: 16px;
}

/deep/.el-checkbox__inner::after {
    border: 2px solid #000000 !important;
    box-sizing: content-box;
    content: "";
    border-left: 0 !important;
    border-top: 0 !important;
    height: 7px;
    left: 4px;
    position: absolute;
    top: 1px;
    transform: rotate(45deg) scaleY(0);
    width: 3px;
    transition: transform 0.15s ease-in 0.05s;
    transform-origin: center;
}
/deep/.el-checkbox__input.is-disabled + span.el-checkbox__label {
    color: #000000;
    cursor: not-allowed;
}

::-webkit-scrollbar {
    width: 0px;
    height: 5px;
    border: 4px solid white;
}
::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
}
::-webkit-scrollbar-track {
    background-color: #f1f1f1;
}
</style>